export function setCondition(key, value) {
  localStorage.setItem(`${key}_condition`, JSON.stringify(value));
}

export function getCondition(key) {
  const res = localStorage.getItem(`${key}_condition`);
  if (res) {
    return JSON.parse(res);
  }
  return {};
}

export function setPageSize(key, value) {
  localStorage.setItem(`${key}_pageSize`, value);
}

export function getPageSize(key) {
  const res = localStorage.getItem(`${key}_pageSize`);
  return res || 1;
}

export function setPage(key, value) {
  localStorage.setItem(`${key}_page`, value);
}

export function getPage(key) {
  const res = localStorage.getItem(`${key}_page`);
  return res || 1;
}
